#ifndef Player_H
#define Player_H

#include "IPlayer.h"
#include "IRenderer.h"
#include "IMediaData.h"
#include "RtuStack.h"
#include "AudioRender.h"
#include "VideoRender.h"
#include "RtuDataSource.h"

#include "glew.h"
#include "glut.h"

class Player : public IPlayer {
public:

	Player(){

		audioRender = new AudioRender;
		mediaSource = new RtuDataSource;

	}
	~Player(){

		//delete mediaSource;
		//delete audioRender;

	}
	int setDataSource(CString url);
	int prepare(CPlayList* VideoList);
	void play();
	void stop();
	void release();
	void OnMessage(Message *message);
	void onMediaData(IMediaData* mediaData);

public:
	int getIPFromUI(CString fullUrl, char* IP);
	int getPortFromUI(CString fullUrl, int* port);
	int getUrlFromUI(CString fullUrl, char* url);
	char* WcharToChar(const wchar_t* wp);

private:

	char strUrl[200];
	char strIP[16];
	int intPort;
};

#endif